<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>      
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title><spring:message code="login.form.passFind" /></title>
<style type="text/css">
.command{width:600px;margin:250px auto;}
</style>
<script type="text/javascript" src="./js/jquery-1.10.2.js"></script>
<script type="text/javascript">
	$(document).ready(function(){
		$("#login").submit(function(event){
			/* var id = $('#id').val();
			var jumin1 = $('#jumin1').val();
			var jumin2 = $('#jumin2').val();
			var sel = $('input:radio[name=sel]:checked').val(); */

			var data = $(this).serialize();
			
			$.getJSON("findPass.do",data,
					function(data){
				if(data==''){
						$('#passwd').html("비밀번호를 찾을수 없습니다.");
				}else
				{
						$('#passwd').html(data.result);
				}
			});
			
			event.preventDefault();
		});
	});
</script>
</head>
<body>	

<div class="command">
	<form:form id="login" commandName="loginCommand">
	<form:errors element="div"/>
	<table border="1" cellpadding="0">
		<tr>
			<td colspan="2">
			<form:radiobutton path="sel" value="1" checked="true" />
				<spring:message code="login.form.rb1"/>
			<form:radiobutton path="sel" value="2" />
				<spring:message code="login.form.rb2"/>
			</td>
		</tr>
		<tr>
			<td><spring:message code="login.form.id"/></td>
			<td><form:input id="id" path="id" /></td><form:errors path="id"/><br>
		</tr>
		<tr>
			<td><spring:message code="login.form.jumin"/></td>
			<td><form:input id="jumin1" path="jumin1"/>-<form:input id="jumin2" path="jumin2"/></td><form:errors path="jumin1"/><form:errors path="jumin2"/>
		</tr>
		<tr>
			<td><spring:message code="login.form.passwd"/></td>
			<td><span id="passwd"></span></td>		
		</tr>
</table>
	<input type="submit" value="<spring:message code="login.form.passFind" />">
</form:form>
	</div>
</body>
</html>